package com.jim.aliceAgent.controller;

import com.jim.aliceAgent.service.AgentChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/agentChat")
public class AgentChatController {

    @Autowired
    private AgentChatService agentChatService;

    @GetMapping()
    public Object agentChat(String query, HttpServletRequest request) {
//        String userId = (String) request.getSession(false).getAttribute("userId");
        return agentChatService.requestChat(null, query);
    }

}
